package isOneBitCharacter;

public class Solution {
    public boolean isOneBitCharacter(int[] bits) {
        int index = 0;
        while(index<bits.length){
            if(bits[index] == 0){
                index++;
            }else {
                if(bits[index] == 1){
                    index+=2;
                    if(index == bits.length){
                        return false;
                    }
                }
            }
        }
        return index == bits.length;
    }
}
